@extends('layouts.base')

@section('title', '报单')
@section('admin-style')
<link rel="stylesheet" href="{{ asset('assets\element-ui\lib\theme-chalk\index.css') }}">
<!-- import Vue before Element -->
<script src="{{ asset('assets\vue\vue.js')}}"></script>

<!-- import JavaScript -->
<script src="{{ asset('assets\element-ui\lib\index.js') }}"></script>
<script src="{{ asset('assets\axios\axios.min.js') }}"></script>
@stop


@section('content')

<!-- ============================================================== -->
<!-- Container fluid  -->
<!-- ============================================================== -->
<div class="container-fluid">
	<!-- ============================================================== -->
	<!-- Bread crumb and right sidebar toggle -->
	<!-- ============================================================== -->
	<div class="row page-titles">
	    <div class="col-md-5 align-self-center">
	        <h3 class="text-themecolor">报单--列表</h3>
	    </div>
	    <div class="col-md-7 align-self-center">
	        <ol class="breadcrumb">
	            <li class="breadcrumb-item"><a href="javascript:void(0)">首页</a></li>
	            <li class="breadcrumb-item">报单管理</li>
	            <li class="breadcrumb-item active">报单列表</li>
	        </ol>
	    </div>
	</div>
	<!-- ============================================================== -->
	<!-- End Bread crumb and right sidebar toggle -->
	<!-- ============================================================== -->

	<!-- ============================================================== -->
	<!-- Start Page Content -->
	<!-- ============================================================== -->
	<div class="row">
	    <div class="col-12">
	        <div class="card">
	            <div class="card-body">
	                <h4 class="card-title">报单列表</h4>
	                <h6 class="card-subtitle"></h6>
                	<div class="card-body">
                        <form method="get" action="{{ route('admin.merchants.jdList') }}">
                            <div class="form-row">
                                <div class="col-md-3 mb-3">
                                  <label for="validationDefault05">手机号</label>
                                  <input type="text" name="phone" class="form-control" id="validationDefault05" placeholder="手机号" value="{{ $phone }}" >
                                </div>
                                <div class="col-md-3 mb-3">
                                  	<label for="validationDefault04">审核状态</label>
                                  	<select name="state" id="select" class="form-control" aria-invalid="false">
	                                    <option value="">请选择</option>
	                                    <option value="0" @if($state == 0) selected @endif>未审核</option>
	                                    <option value="1" @if($state == 1) selected @endif>审核中</option>
	                                    <option value="2" @if($state == 2) selected @endif>审核失败</option>
	                                    <option value="3" @if($state == 3) selected @endif>审核成功</option>
                                	</select>
                                </div>
                            </div>
                            <button class="btn btn-primary" type="submit">筛选</button>
                            <a href="{{ route('admin.merchants.jdList') }}" class="btn btn-info">重置</a>
                        </form>
                        {{-- @can('admin.merchants.create')
                        <a class="btn btn-success float-right" href="{{ route('admin.merchants.create') }}"><i class="fas fa-plus"></i> 添加</a>   
                        @endcan    --}} 
                    </div>        
	                <div class="table-responsive">
	                    <table id="demo-foo-addrow" class="table table-bordered m-t-30 table-hover contact-list" data-paging="true" data-paging-size="7">
	                        <thead>
	                            <tr>
	                                <th>ID</th>
	                                <th>商户名称</th>
	                                <th>店铺名称</th>
	                                <th>简称</th>
	                                <th>电话</th>
	                                <th>状态</th>
	                                <th>审核信息</th>
	                                <th>创建时间</th>
	                                <th>操作</th>
	                            </tr>
	                        </thead>
	                        <tbody>
	                        	@foreach($jds as $value)
	                            <tr>
	                                <td>{{ $value->id }}</td>
	                                <td>{{ optional($value->merchant)->name }}</td>
	                                <td>{{ $value->seller_name }}</td>
	                                <td>{{ $value->seller_short }}</td>
	                                <td>{{ $value->person_phone }}</td>
	                                <td>{{ post_pay($value->state) }}</td>
	                                <td>{{ $value->opinion }}</td>
	                                <td>{{ $value->created_at }}</td>
	                                <td>{!! $value->actionButton !!}</td>
	                            </tr>
	                            @endforeach
	                        </tbody>
	                    </table>
	                    {{ $jds->appends(['phone' => $phone, 'state' => $state])->links() }}
	                </div>
	            </div>
	        </div>
	    </div>
	</div>
</div>         
                        
@stop